package day17_Inet.作业.作业1;

import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;

public class Clien {
    public static void main(String[] args) throws Exception {
        Scanner scanner = new Scanner(System.in);
        Socket socket = new Socket("192.168.3.172",8888);
        String s = scanner.next();
        OutputStream os = socket.getOutputStream();
        byte[] bytes = s.getBytes();
        os.write(bytes);
        InputStream is = socket.getInputStream();
        byte[] bytes1 = new byte[1024];
        int i = is.read(bytes1);
        System.out.println(new String(bytes1,0,i));
        socket.close();
    }
}
